package pl.un4giv3n.mightvsmagic.utils.display;

import javax.servlet.jsp.PageContext;

import org.displaytag.model.TableModel;

import pl.un4giv3n.mightvsmagic.entity.Item;

public class DisplaySellItemDecorator extends DisplayItemDecorator{

	@Override
	public void init(PageContext pageContext, Object decorated,
			TableModel tableModel) {
		super.init(pageContext, decorated, tableModel);
	}
	
	public String getPrice(){
		Item item = (Item) getCurrentRowObject();
		int price = item.getPrice();
		int premiumPrice = item.getPremiumPrice();
		return premiumPrice > 0 ? premiumPrice/10+" <img src=\"./img/icons/dragonteeth.jpg\" alt=\"Smocze zęby\" title=\"Smocze zęby\"/>" : price/10+" <img src=\"./img/icons/gold.jpg\" alt=\"Złoto\" title=\"Złoto\"/>";
	}
}
